import { defineStore } from "pinia";
import { ref } from 'vue'
import { getCategoryAPI } from "@/api/layout";
 
export const useCategoryStore = defineStore('category', () => {
  const categoryList = ref([])
  const getCategory = async () => {
     // 获得分类列表
     const { data: { result } } = await getCategoryAPI()
     categoryList.value =  result
  }
  getCategory()
  return {
    categoryList
  }
})